﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;



namespace LRT
{
    //public class Class1
    //{
    //    public delegate void SampleEventHandler();
    //    public event SampleEventHandler SampleEvent;
        
    //}

 

    public static class Parse
    {


        public static int[] AsInt(this string param)
        {
            var strs = param.Split(new char[] { ',' });
            var intlist = Array.ConvertAll<string, int?>(strs, s => { int i; if (int.TryParse(s, out i)) return i; return null; });
            return (from i in intlist where i.HasValue select i.Value).ToArray();

            var j = Convert.ToInt32("0");

        
        }

        public static int[] ParseInt(this string param)
        {
            var strslist = param.Split(new char[] { ',' });
            var intlist = new List<int>();
            int i;
            foreach (var item in strslist)
            {
                if (!int.TryParse(item, out i))
                    continue;
                intlist.Add(i);
            }
            return intlist.ToArray();

        }
    }

    public class Program
    {
        public static void Main(string[] args)
        {

            //var s = (new Select("SELECT * FROM [User]"))
            //    .Where("ID > 1")
            //    .And("Number = 0")
            //    .AndExpression(cdt).ToSqlString();



            //var s = (new Select("SELECT * FROM [User]"))
            //    .Where("ID > 1")
            //    .And("Number = @Name")
            //    .OrExpression(cdt).ToSqlString();

            //var sql = Parse.Select("*").From("[Users]").Where();

            //var s = (new Select())
            //    .Columns("sd,df,fg,er5,")
            //    .From("sd")
            //    .Where("ID > 1")
            //    .And("Number = @Name")
            //    .OrExpression(cdt).ToSqlString();






        }


    }


}
